﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace QiHe
{
    public partial class DeptNumberList : Form
    {
        DataSet DeptList;
        public DeptNumberList()
        {
            InitializeComponent();
        }

        private void DeptNumberList_Load(object sender, EventArgs e)
        {
            MedEQ.Service1 sop = new MedEQ.Service1();
            DeptList = sop.Department_List_By_PID("1");
            listBox1.DataSource = DeptList.Tables[0];
            listBox1.DisplayMember = "Name";
            listBox1.ValueMember = "DeptNumber";
        }

        private void listBox1_DoubleClick(object sender, EventArgs e)
        {
            skinTextBox1.Text = DeptList.Tables[0].Rows[listBox1.SelectedIndex][2].ToString();
        }

        private void listBox1_Click(object sender, EventArgs e)
        {
            skinTextBox1.Text = DeptList.Tables[0].Rows[listBox1.SelectedIndex][2].ToString();
        }
    }
}
